package com.yuwei.database

import android.content.Context
import androidx.room.Room
import com.yuwei.database.dao.*

object RoomDBUtils {
    private lateinit var database: AppDataBase
    /**
     * 初始化数据库
     */
    fun initRoomDB(context: Context){
        database =Room.databaseBuilder(context, AppDataBase::class.java,"park.db").build()
    }

    /**
     * 获取数据库实例
     */
    fun getVideoDao(): VideoDao {
        return database.getVideoDao()
    }
    fun getGoodsDao(): GoodsDao {
        return database.getGoodsDao()
    }
    fun getOrderDao(): OrderDao {
        return database.getOrderDao()
    }
    fun getAddressDao(): AddressDao {
        return database.getAddressDao()
    }
    fun getFavVideoDao(): FavVideoDao {
        return database.getFavVideoDao()
    }
}